Ryan Miller
Animation from “Introduction to Data Science - Data Analysis and Prediction Algorithms with R” by Rafael A. Irizarry
span
span = 0.5, the nearest 50% of the data will be used to fit the local regression at the point \(x_0\)span = 0.5 and \(n = 100\), the 50 datapoints closest to \(x_0\) will be included in the neighborhoodspan specificationsAnimation from “Introduction to Data Science - Data Analysis and Prediction Algorithms with R” by Rafael A. Irizarry
span = 0.2 is still too noisy, but increasing to span = 0.6 does a good job capturing the signalp1 <- ggplot(df, aes(x = x, y = y)) + geom_line(color = "red") + labs(title = "Signal")
p2 <- ggplot(df, aes(x = x, y = yy)) + geom_point() + geom_line(aes(x = df$x, y = df$y), color = "red") + geom_smooth(method = "loess", span = 0.2) + labs(title = "span = 0.2")
p3 <- ggplot(df, aes(x = x, y = yy)) + geom_point() + geom_line(aes(x = df$x, y = df$y), color = "red") + geom_smooth(method = "loess", span = 0.5) + labs(title = "span = 0.6")
grid.arrange(p1,p2,p3)